home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib8 / v_10_04 / 1004090a < prev    next >
Encoding:
Text File  |  1995-11-01  |  394 b   |  22 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #define NUMELEMENTS(x) (sizeof(x)/sizeof(x[0]))
  6.  
  7. typedef struct {
  8.     const char *stack_name;
  9.     int *pstack;
  10.     size_t stack_ptr;
  11.     size_t max_stack;
  12. } stack;
  13.  
  14. int array1[1];
  15. static int array2[30];
  16.  
  17. stack stack1 = {"stack1", array1, 0, NUMELEMENTS(array1)};
  18. stack stack2 = {"stack2", array2, 0, NUMELEMENTS(array2)};
  19. stack stack3 = {"stack3", NULL,   0, 0};
  20.  
  21.  
  22.